package com.bfxy.rabbitmq.consumer;

import com.bfxy.rabbitmq.util.RabbitUtil;
import com.rabbitmq.client.Channel;

/**
 * Created by deng_wb on 2020/3/14
 */
public class Producer {

    public static void main(String[] args) throws Exception{
        Channel channel = RabbitUtil.producerChannel();
        String exchange = "test_consumer_exchange";
        String routingKey = "consumer.save";

        String msg = "Hello RabbitMQ Consumer Message";

        for (int i = 0; i < 5; i++) {
            channel.basicPublish(exchange,routingKey,true,null,msg.getBytes());
        }
    }
}
